package com.meilai.project.controller.web.adMake.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.meilai.project.core.bean.SuperEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Objects;

/**
 * <p>
 * 制作单-配送
 * </p>
 *
 * @author 张驰
 * @since 2022-08-16
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("bill_ad_make_supplier_confirm")
@ApiModel(value="BillAdMakeSupplierConfirm对象", description="制作单-供应商确认")
public class BillAdMakeSupplierConfirm extends SuperEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "批次ID，生成确认单时插入")
    private String batch_id;

    @ApiModelProperty(value = "制作表id，对应bill_ad_make的id")
    private Long bill_ad_make_id;

    @ApiModelProperty(value = "供应商id，对应supplier的id")
    private Long supplier_id;

    @ApiModelProperty(value = "送达时间-供应商确认时填写")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime deliver_time;

    @ApiModelProperty(value = "确认时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime confirm_time;

    @ApiModelProperty(value = "签名图片地址-供应商确认时签字")
    private String sign_img_url;

    @ApiModelProperty(value = "备注")
    private String memo;

    @ApiModelProperty(value = "确认单总额")
    private BigDecimal total;

    public static final String BATCH_ID = "batch_id";

    public static final String BILL_AD_MAKE_ID = "bill_ad_make_id";

    public static final String SUPPLIER_ID = "supplier_id";

    public static final String DELIVER_TIME = "deliver_time";

    public static final String SIGN_IMG_URL = "sign_img_url";

    public static final String MEMO = "memo";

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof BillAdMakeSupplierConfirm)) return false;
        if (!super.equals(o)) return false;
        BillAdMakeSupplierConfirm that = (BillAdMakeSupplierConfirm) o;
        return Objects.equals(getBill_ad_make_id(), that.getBill_ad_make_id()) &&
                Objects.equals(getSupplier_id(), that.getSupplier_id());
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), getBill_ad_make_id(), getSupplier_id());
    }
}
